<?php
/**
 * add transaction block
 */
function get_add_transaction_block(){
	drupal_add_js(drupal_get_path("module","accounting")."/scripts/acctg.js");
//	$s = "$(function(){  });";
//	drupal_add_js($s,"inline");
	
	$s = "<div id=\"acctg-transaction-add-block\">";
	$s .= "\n\t<input id=\"acctg-transaction-add-account\" type=\"text\" />";
	$s .= "</div>";
	
	return $s;
}

/**
 * add account block
 */
function get_add_account_block($acct_id=NULL){
	$acct = array();
	if(isset($acct_id)){
		$acct = Accounting::get_instance()->get_account($acct_id);
	}
	
	$s = "<div id=\"acctg-acct-add\">";
	$s .= "\n\t<h3>New Account</h3>";
	$s .= "\n\t<input id=\"acct-id\" type=\"hidden\" value=\"$acct_id\"/>";
	$s .= "\n\t<label>Title<em>*</em><input id=\"acct-title\" class=\"autocomplete\" type=\"text\"/></label>";
	$s .= "\n\t<label>Description<em>*</em><input id=\"acct-desc\" type=\"text\"/></label>";
	if(isset($acct_id)){
		$s .= "\n\t<label><input id=\"acct-enable\" type=\"checkbox\" />";
	}
	$s .= "\n</div>";
	return $s;
}